// vite.config.ts
import { createSvgIconsPlugin } from "file:///D:/js_proj/vite-project/node_modules/.pnpm/vite-plugin-svg-icons@2.0.1_vite@4.5.1/node_modules/vite-plugin-svg-icons/dist/index.mjs";
import { defineConfig, loadEnv } from "file:///D:/js_proj/vite-project/node_modules/.pnpm/vite@4.5.1_@types+node@18.19.3_sass@1.69.5/node_modules/vite/dist/node/index.js";
import vue from "file:///D:/js_proj/vite-project/node_modules/.pnpm/@vitejs+plugin-vue@4.5.2_vite@4.5.1_vue@3.3.11/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import { viteMockServe } from "file:///D:/js_proj/vite-project/node_modules/.pnpm/vite-plugin-mock@3.0.0_esbuild@0.19.8_mockjs@1.1.0_vite@4.5.1/node_modules/vite-plugin-mock/dist/index.mjs";
import path from "path";
var vite_config_default = defineConfig(({ command, mode }) => {
  const env = loadEnv(mode, process.cwd());
  return {
    plugins: [
      vue(),
      createSvgIconsPlugin({
        // Specify the icon folder to be cached
        iconDirs: [path.resolve(process.cwd(), "src/assets/icons")],
        // Specify symbolId format
        symbolId: "icon-[dir]-[name]"
      }),
      // 配置mock插件
      viteMockServe({
        // default
        mockPath: "mock",
        enable: command === "serve"
        // 保证开发阶段可以使用Mock接口
      })
    ],
    resolve: {
      alias: {
        "@": path.resolve("./src")
        // 相对路径别名配置，使用 @ 代替 src
      }
    },
    // scss全局变量配置
    css: {
      preprocessorOptions: {
        scss: {
          javascriptEnabled: true,
          additionalData: '@import "./src/styles/variable.scss";'
        }
      }
    },
    // 配置代理跨域
    server: {
      proxy: {
        [env.VITE_APP_BASE_API]: {
          // 获取数据的服务器地址设置
          target: env.VITE_SERVE,
          // 是否代理跨域 ture 是 false 否
          changeOrigin: true,
          // 路径重写
          rewrite: (path2) => path2.replace(/^\/api/, "")
        }
      }
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSw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